 <?php
//=========================<script réaliser par :DITINI ANASS>===================
 
	include("verif_session.php");
	include("bdd_connection.php");
	include_once('config.php');
	include_once('ConnectBD.php');
	require_once("dao/materielCommandeDao.php");
    require_once("dao/nomadeDao.php");
    require_once("dao/tacheDao.php");
    include_once('Connect_pdo.php');
	
	  extract($_GET);
	  extract($_POST);
	  $action = (!isset($action))?"default":$action; // tester si $action existe ou non
	  if($action=="change"){
		$materielcommandeDao=new materielCommandeDao();
		echo $materielcommandeDao->change_state($state, $id_change);
	                       }
	else if($action = "default"){
		$materielcommande=new materielCommandeBean();
		$materielcommandeDao=new materielCommandeDao();
		$nomadeDao=new nomadeDao();
		$tacheDao=new tacheDao();
		$listmaterielcommande=$materielcommandeDao->loadAllMaterielCommande();

		$tpl->assign("nomadeDao",$nomadeDao);
		$tpl->assign("tacheDao",$tacheDao);
		$tpl->assign("listmaterielcommande",$listmaterielcommande);
		$tpl->display("materielcommande.html");
	                            }
?>
	